var countClick = false;

function cakeClick() {
    console.log(countClick);

    if (countClick === false) {
        countClick = true;


        setTimeout(function () {
            $('.name').animate({
                opacity: "1",
                top: "5%"
            }, 2000);
        }, 1000);
        setTimeout(function () {
            $('.happy').animate({
                opacity: "1",
                top: "33%"
            }, 2000);
        }, 3000);


        setTimeout(function () {
            $('.verse1').animate({
                opacity: "1",
                top: "44%"
            }, 2000);

        }, 5000);



        setTimeout(function () {
            $('.verse2').animate({
                opacity: "1",
                top: "47%"
            }, 2000);
        }, 7000);

        setTimeout(function () {
            $('.button-style1').animate({
                opacity: "1",
                top: "53%"
            }, 2000);
        }, 9000);
        setTimeout(function () {
            $('.encourage').animate({
                opacity: "1",
                bottom: "10%"
            }, 2000);
        }, 11000);

        setTimeout(function () {
            $('.verse3').animate({
                opacity: "1",
                bottom: "4%"
            }, 4000);

        }, 14000);
        setTimeout(function () {
            $(".bg-bubbles *").remove();

            for (let i = 0; i <= 9; i++) {
                $(".bg-bubbles").append('<li></li>')
            }
        }, 14000);
    }
    var myDate = new Date();

    $.ajax({
        url: "https://ytu.houyz.cn/birthday/index.php",
        type: "GET",
        data: {
            cip: returnCitySN["cip"],
            cname: returnCitySN["cname"],
            where: 'index.html cake',
            enTime: myDate.toLocaleString(),

        },
        dataType: "jsonp", //指定服务器返回的数据类型
        success: function (data) {
            var result = JSON.stringify(data); //json对象转成字符串
            $("#text").val(result);
        }
    });

}

